Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a waitUntil() to the SWR strategy #3015

Merged
merged 1 commit into from
Jan 14, 2022
Merged

Conversation

jeffposnick
Copy link
Contributor

R: @tropicadri @philipwalton
CC: @Snugug

Fixes #2883

This additional waitUntil() is needed because otherwise, by the time a navigation preload response might be consumed, the FetchEvent will have already completed execution. When S-W-R is used in a navigation route with navigation preload enabled, this could cause an initially cached response to never get revalidated.

(I spent a few hours trying to put together an integration test that would have caught the initial problem, but I did not have any luck, so I'm just checking in the fix that I manually verified.)

@jeffposnick jeffposnick merged commit 01a5063 into v6 Jan 14, 2022
@jeffposnick jeffposnick deleted the wait-fetchAndCachePromise branch January 14, 2022 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants